Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Important details for oauth2 documentation #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

webermax
Copy link

@webermax webermax commented Jan 4, 2021

Had a hart time following the manual adding api endpoint protection.

Maximilian Weber added 2 commits January 4, 2021 18:55
@@ -285,6 +296,8 @@ final class AuthorizationListener
public function __invoke(MvcAuthEvent $mvcAuthEvent)
{
$authorization = $mvcAuthEvent->getAuthorizationService();

$authorization->addRole('user');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment on what this role may mean? (magic constants are problematic, even in examples)

Copy link
Author

@webermax webermax Jan 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example code fails with a fatal error about missing role "user" when executing it without adding the new role:

https://discourse.laminas.dev/t/role-user-not-found-following-authorizations-docs/1397

Adds a comment for adding user role in user-differentiation.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants